﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>
<%@ Import Namespace="System.Collections.Generic" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    事件处理列表
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <%
        IEnumerable<EventRecordDetail> eventRecords = (IEnumerable<EventRecordDetail>)ViewData["eventRecords"];
        User user = (User) ViewData["user"];
        string[] types = (string[])ViewData["types"];
        string[] priorities = (string[])ViewData["priorites"];
    %>
    
    <table id="spdata" cellpadding="4" cellspacing="0" class="com_from_table3" style="vertical-align:middle;">
        <tr>
            <th style="width:30px;">编号</th>
            <th style="width:192px;">事件名称</th>
            <th style="width:128px;">事件现场</th>
            <th>事件类别</th>
            <th>事件级别</th>
            <th>上报时间</th>
            <th>延续天数</th>
            <th>上报人</th>
            <th>目前处理进度</th>
            <th>事件状态</th>
            <th>&nbsp;</th>
        </tr>
        <%
            int i = 0;
          foreach (EventRecordDetail e in eventRecords)
          {
              i++;
        %>
        <tr>
            <td class="lab" style="text-align:center;"><%=i %></td>
            <td style="padding-left:0.8em;"><%=Html.CutString(e.Name, 30, "...") %></td>
            <td style="padding-left:0.8em;"><%=e.StackName %></td>
            <td style="padding-left:0.8em;"><%=types[e.Type] %></td>
            <td style="padding-left:0.8em;"><%=priorities[e.Priority] %></td>
            <td style="text-align:center;"><%=e.OccurredDate.ToString("yyyy-MM-dd HH:mm") %></td>
            <td style="text-align:center;"><%=(DateTime.Now.Date - e.OccurredDate.Date).Days + 1%></td>
            <td style="padding-left:0.8em;"><%=e.UserName %></td>
            <td style="padding-left:0.8em;"><%=e.Progress %>%</td>
            <td style="padding-left:0.8em;"><%=e.Status == 0 ? "正在跟踪" : "待确认结束"%></td>
            <td style="padding-left:0.8em;">
            <%=Html.ActionLink("进程详情", "Track", new { eventId = e.Id }, new { style = "margin-left:15px" })%>
            </td>
        </tr>
        <%} %>  
    </table>
</asp:Content>
